package com.nova.view;

import com.nova.NovaConfig;

import android.util.Log;

public class NovaLog {

	public static void println(Object msg) {
		if (NovaConfig.LOG)
			System.out.println(msg);
	}

	public static void v(String tag, String msg) {
		log(tag, msg, Level.V);
	}

	public static void d(String tag, String msg) {
		log(tag, msg, Level.D);
	}

	public static void i(String tag, String msg) {
		log(tag, msg, Level.I);
	}

	public static void w(String tag, String msg) {
		log(tag, msg, Level.W);
	}

	public static void e(String tag, String msg) {
		log(tag, msg, Level.E);
	}

	private static void log(String tag, String log, Level level) {
		if (!NovaConfig.LOG) {
			return;
		}
		switch (level) {
		case D:
			Log.d(tag, log);
			break;
		case E:
			Log.e(tag, log);
			break;
		case I:
			Log.i(tag, log);
			break;
		case V:
			Log.v(tag, log);
			break;
		case W:
			Log.w(tag, log);
			break;
		}
	}

	private static enum Level {
		V, D, I, W, E;
	}
}
